using Microsoft.AspNetCore.Http;

namespace ContentmanagementBaseWrite.API.Services
{
    /// <summary>
    /// MinIO服务接口
    /// </summary>
    public interface IMinioService
    {
        /// <summary>
        /// 上传文件到MinIO
        /// </summary>
        /// <param name="file">要上传的文件</param>
        /// <param name="bucketName">存储桶名称</param>
        /// <param name="objectName">对象名称</param>
        /// <returns>文件访问URL</returns>
        Task<string> UploadFileAsync(IFormFile file, string bucketName, string objectName);

        /// <summary>
        /// 检查存储桶是否存在，不存在则创建
        /// </summary>
        /// <param name="bucketName">存储桶名称</param>
        /// <returns>是否存在</returns>
        Task<bool> EnsureBucketExistsAsync(string bucketName);

        /// <summary>
        /// 删除文件
        /// </summary>
        /// <param name="bucketName">存储桶名称</param>
        /// <param name="objectName">对象名称</param>
        /// <returns>是否删除成功</returns>
        Task<bool> DeleteFileAsync(string bucketName, string objectName);

        /// <summary>
        /// 获取文件访问URL
        /// </summary>
        /// <param name="bucketName">存储桶名称</param>
        /// <param name="objectName">对象名称</param>
        /// <param name="expiresInSeconds">过期时间（秒）</param>
        /// <returns>预签名URL</returns>
        Task<string> GetPresignedUrlAsync(string bucketName, string objectName, int expiresInSeconds = 7 * 24 * 3600);
    }
} 